package com.cqdev.washer.infra.enums;

import lombok.Getter;

/**
 * @author yunfei.li
 *         类描述: TODO
 *         日期： 2018/6/22
 */
public enum DBDriverType {

    MYSQL("com.mysql.jdbc.Driver"),

    HIVE("org.apache.hive.jdbc.HiveDriver");

    @Getter
    private String driverClassName;

    DBDriverType(String driverClassName) {
        this.driverClassName = driverClassName;
    }

    public static String driverClassOfName(String dbType) {
        if (dbType == null) {
            throw new IllegalArgumentException();
        }
        DBDriverType dbDriverType = valueOf(dbType);
        if (dbDriverType == null) {
            throw new IllegalArgumentException();
        }
        return dbDriverType.getDriverClassName();
    }
}
